Project Structure
source sets
├── source components(Java Plugin)
└── source components(Android Plugin)
source sets
- src/main/
- src/androidTest/
source components(Java Plugin)
source components(Android Plugin)
- AndroidManifest.xml
- res/
- assets/
- aidl/
- rs/
- jni/
Project Structure 展開
src
├── main
│ ├── java/
│ ├── resources/
│ ├── res/
│ ├── assets/
│ ├── aidl/
│ ├── rs/
│ ├── jni/
│ └── AndroidManifest.xml
│
└── androidTest
├── java/
├── resources/
├── res/
├── assets/
├── aidl/
├── rs/
└── jni/
// src/androidTest/AndroidManifest.xml is created automatically
Configuring the Structure
Java 的設定方式1 2 3 4 5 6 7 8 9 10 11 12
| sourceSets { main { java { srcDir 'src/java' } } }
sourceSets { main.java.srcDirs = ['src/java'] }
|
Android 的設定方式1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| android { sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] }
androidTest.setRoot('tests') } }
|